package top.linuyx.pojo.param;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;

/**
 * @Author Linuyx
 * @Description Account注册请求体
 * @Date Created in 2021-04-09 8:59
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class AccountRegisterParam implements Serializable {

    /**
     * 账户id(在注册时用来接受返回account表中新增账户的id，用来关联user表)
     */
    private Long id;

    /**
     * 用户名
     */
    @NotBlank(message = "用户名不能为空")
    @Size(min = 6,max = 16,message = "用户名长度必须在6-16位之间")
    private String username;

    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空")
    @Size(min = 6,max = 8,message = "密码长度必须在8-16位之间")
    private String password;

    /**
     * 随机盐
     */
    private String salt;

    /**
     * 角色集合
     */
    private List<String> roles;

}
